home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
bbsutil
/
ubbs208b.zip
/
UBBSFMTS.TXT
< prev
next >
Wrap
Text File
|
1991-07-24
|
39KB
|
972 lines
UltraBBS v2.08 File Formats
07/25/91
Message File Format
-------------------
In the messages file (extension ".DAT"), each record is 150 bytes long. The
first record in each messages file has the following format:
struct firstrecord
{
long nextrecord;
long highmsgnum;
long lowmsgnum;
long lastfidomsgimported;
char reserved[134];
}
The nextrecord variable contains the next record # that should be used in
the messages file (first record in file is record # 0). The highmsgnum
variable contains the current high message number in the message base, and
lowmsgnum contains the current low message number in the message base.
The lastfidomsgimported variable is used by the FIDOCVT program and
is the number of the last message that was imported by FIDOCVT (or the
last message that has already been exported to FIDO format).
The header of each message in the messages file has the following format:
struct msgrecord
{
long msgnum;
unsigned char from[26];
unsigned char to[26];
unsigned char msgdate[9];
unsigned char msgtime[6];
unsigned char subject[26];
unsigned char msgpass[21];
unsigned char active;
long referto;
unsigned char datercvd[9];
unsigned char records;
unsigned char private;
unsigned char timercvd[6];
unsigned char echoflag;
unsigned char rr;
unsigned char perm;
unsigned char attached;
int hasreplies;
unsigned char reserved[4];
}
All character arrays ("strings") are NULL TERMINATED character arrays!
They are NOT padded with spaces! This applies for the rest of this file,
except where specifically stated otherwise. Whatever follows the null byte
is of no consequence, it is ignored.
The msgnum variable is the number of this message. The from variable
is the name of the user who entered the message. The to variable is
the name of the user to whom the message was entered. The msgdate variable
is the date on which the message was entered ("MM/DD/YY" format). The
msgtime variable is the time on which the message was entered ("HH:MM"
format). The subject variable is the subject of the message. The msgpass
variable is the password of the message, it should be null if there is no
password on the message. The active variable is nonzero if the message is
active, zero if the message is killed. The referto variable contains the
message number of the message which this message is a reply off of, 0
if this message is not a reply to any other message. The datercvd variable
contains the date on which this message was received ("MM/DD/YY" format),
it should be a 0 length string if the message has not been received yet.
The records variable contains the # of records in the message's text area
(it does NOT include the header!). The private variable is nonzero if the
message is receiver only, or zero if it is public or password protected.
The timercvd variable contains the time on which this message was received
("HH:MM" format), it should be a 0 length string if the message has not been
received yet. The echoflag variable is used only for conferences designated
as 'echo' conferences. If nonzero, it is assumed that the message is
supposed to be exported for echomail, if zero, it should stay only in the
local message base. The rr variable is nonzero if the user has requested a
return receipt, zero if he has not (a return receipt is generated when the
message is first received, the rr flag is NOT changed). The perm variable
is nonzero if the message cannot be killed by the receiver, zero if it can
(this should only be used on public messages). The attached variable is
nonzero if a file is attached to the message, zero if a file is not
attached. The hasreplies variable is nonzero if the message has replies
to it, otherwise it is set to zero. The reserved variable is used for
future use and should be set to all nulls. If a file is attached, it will
be placed in a subdirectory off of your attach directory named
MSGNUMBER.CONF (for example, ATTACHDIR\1.0\filename.ext for message # 1 in
conference # 0).
The actual text records of the message (following each header) are strings
of text, each representing a line of the message, followed by (Ctrl-A)
characters. The very last (Ctrl-A) of the message (representing the
(Enter) on the last line of the message) is followed by a (Ctrl-B)
character. The rest of the current record is padded out by unpredictable
characters to the next 150-byte boundary.
The records in the messages index file (extension ".NDX") have the
following format:
struct messageindexrecord
{
long record;
unsigned char to[26];
unsigned char from[26];
unsigned char private;
unsigned char active;
unsigned char subject[26];
}
The index begins at the low message number specified in the first record of
the message file. The long integer is the record # in the messages file of
the message it represents (first record in file is record # 0 again). For
example, if the low message number is 5, and you wanted to find message # 5
in the messages file, you would look at the first record in the index file
to get message # 5's record in the messages file. The to, from, private,
active, and subject fields should correspond to those fields in that
message's actual header. Since the index file is based on the lowmsgnum
variable, you will not want to change the lowmsgnum variable at any time
unless your program does a complete pack of the message files.
FileBase File Format
--------------------
In the FileBase data file (extension ".DAT"), each record is 338 bytes
long. Each file entry in the file has the following format:
struct filerecord
{
unsigned char file[13];
unsigned long filesize;
unsigned char uploadedby[26];
int timesdled;
unsigned char filelocation[41];
unsigned char lastdl[9];
unsigned char dateoful[9];
int freefile;
unsigned char id[5];
unsigned char descrip[225];
int deleteflag;
}
The file variable contains the actual file name of the file on the BBS.
The filesize variable contains the size (in bytes) of the file on disk, or
0 if the file has a "variable" size. The uploadedby field contains the full
name of the user who uploaded the file. The timesdled field contains the
number of times that this file has been downloaded. The filelocation
variable contains the actual physical location of the file (on the disk
drive). The lastdl and dateoful fields contain (in "MM/DD/YY" format) the
last date the file was downloaded, and the date that the file was uploaded,
respectively. The freefile variable is nonzero if the file is free (no
download charge), or zero if not. The idvariable contains the 4 character
Directory ID of the file. The descrip variable contains the description of
the file (5 lines, 45 characters each). The descrip variable is NOT null
terminated and is padded with spaces! The deleteflag variable is nonzero
if the file is flagged for deletion, zero if not.
The FileBase index files have a one-character extension that is the first
letter in their file name. The records in the FileBase index files have
the following format:
struct fileindexrecord
{
unsigned char file[13];
unsigned char id[5];
long record;
long binarydate;
}
The file variable contains the file name of the file. The id variable
contains the 4 character Directory ID of the file. The record variable
contains the actual record (again, first record in data file is # 0) in the
FileBase data file where complete information on the file is stored. The
binarydate field contains the file's date as a long integer. This value is
obtained by rearranging the fields of the date to YYMMDD and then taking
the value into a long integer (ie: 10/12/90 = 901012).
User File Format
----------------
In the Users data file (extension ".DAT"), each record is 1695 bytes
long. Each user entry in the file has the following format:
struct userrecord
{
unsigned char name[26];
unsigned char userpass[21];
int security;
int expert;